// 静态路由配置
import Home from '@/views/home'
import Cart from '@/views/cart'
import Category from '@/views/category'
import Confirm from '@/views/confirm'
import Detail from '@/views/detail'
import Login from '@/views/login'
import Mine from '@/views/mine'
import Worthbuy from '@/views/worthbuy'
import Search from '@/views/search'
import NavBar from '@/components/nav-bar'
import MainBar from '@/components/main-bar'
import SearchJumpBar from '@/components/searchjump-bar'
import TabBar from '@/components/tab-bar'
import SearchBar from '@/components/search-bar'
const routes = [
  {
    path: '/',
    redirect: '/home', // 重定向
    meta: {},
  },
  {
    path: '/home',
    name: '/home',
    components: {
      header: MainBar,
      default: Home,
      footer: TabBar,
    },
    meta: {
      icon: '&#xe7ac;',
      title: '首页',
      inTabBar: true,
      noBack: true,
      replace: true,
    },
  },
  {
    path: '/category',
    components: {
      header: SearchBar,
      default: Category,
      footer: TabBar,
    },
    meta: {
      icon: '&#xe66e;',
      title: '分类',
      inTabBar: true,
      noBack: true,
      replace: true,
    },
  },
  {
    path: '/confirm',
    components: {
      default: Confirm,
    },
    meta: {
      title: '确认订单',
    },
  },
  {
    path: '/detail',
    components: {
      default: Detail,
    },
    meta: {
      title: '商品详情',
    },
  },
  {
    path: '/login',
    components: {
      header: NavBar,
      default: Login,
    },
    meta: {
      title: '登录',
    },
  },
  {
    path: '/search',
    components: {
      header: SearchJumpBar,
      default: Search,
    },
    meta: {
      title: '搜索',
    },
  },
  {
    path: '/worthbuy',
    components: {
      header: NavBar,
      default: Worthbuy,
      footer: TabBar,
    },
    meta: {
      icon: '&#xe63d;',
      title: '值得买',
      inTabBar: true,
      noBack: true,
      replace: true,
    },
  },
  {
    path: '/cart',
    components: {
      default: Cart,
      footer: TabBar,
    },
    meta: {
      icon: '&#xe61b;',
      title: '购物车',
      inTabBar: true,
      noBack: true,
      replace: true,
    },
  },
  {
    path: '/mine',
    components: {
      default: Mine,
      footer: TabBar,
    },
    meta: {
      icon: '&#xe883;',
      title: '个人中心',
      inTabBar: true,
      noBack: true,
      replace: true,
    },
  },
]

export default routes
